﻿@model Model3Objects<GridPagedList<Product>, GridPagedList<Category>, GridPagedList<Category>>
@using Domain
@using ASPMVCUtil.Helpers.Html.Grid
@using ASPMVCUtil.Models
@using ShowcaseMVC5.Models
@{
    ViewBag.Title = ShowcaseMVC5.GridResources.Title;
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>@Html.ActionLink(ShowcaseMVC5.HomeResources.ShowcaseTitle, "Showcase", "Home") > @ShowcaseMVC5.GridResources.Title > @ShowcaseMVC5.GridResources.Complete</h2>

<table style="width: 100%">
        <tr>
            <td style="vertical-align: top">      
                <fieldset style="padding-top: 25px">
                    <legend>@ShowcaseMVC5.GridResources.Categories</legend>
                    @{
                        IEnumerable<GridColumn<Category>> columnasCategorias = new GridColumn<Category>[] {
                           GridColumn<Category>.create("Id", "50", true, new GridCellTemplateIcon<Category>(Url.Content("~/Images/id.png"))),
                           GridColumn<Category>.create("Name", "100")
                       };
                    }
                    @Html.Grid(columnasCategorias, Model.Object2, "Default", GridPagerPosition.Header, 0, true, true, true, false, null)
                    @Html.Grid(columnasCategorias, Model.Object3, "Default", GridPagerPosition.Header, 0, false, false, false, false, null, new GridRowFormatterImplCategory())
                </fieldset>     
            </td>
            <td>       
                <fieldset>
                    <legend>@ShowcaseMVC5.GridResources.Products</legend>
                @{
                    IEnumerable<GridColumn<Product>> columnas = new GridColumn<Product>[] {
                        GridColumn<Product>.create("Id", "70", true, 
                            new GridCellTemplateIcon<Product>(Url.Content("~/Images/id.png"))),
                        GridColumn<Product>.create("Name", "*", true, null, new string[] { "centered" }),
                        GridColumn<Product>.create("Price", "100", true, new PriceTemplate<Product>()),
                        GridColumn<Product>.create("Release", "110", true, new DateTemplate <Product>()),
                        GridColumn<Product>.create("Quantity", "100", false, new QuantityTemplate<Product>()),
                        GridColumn<Product>.create("Category.Name", "100", "Category")
                   };
                }
                @Html.Grid(columnas, Model.Object1, "Default", GridPagerPosition.Header, 250, true, true, false)
                </fieldset>
            </td>
        </tr>
    </table>

    <h3>About this example</h3>
    <script type="text/javascript">
        $(function () {
            $("#tabs").tabs();
        });
	</script>
    <div id="tabs">
	    <ul>
		    <li><a href="#tabs-1">Description</a></li>
		    <li><a href="#tabs-2">View</a></li>
		    <li><a href="#tabs-3">Controller</a></li>
		    <li><a href="#tabs-4">Model</a></li>
		    <li><a href="#tabs-5">Options</a></li>
	    </ul>
	    <div id="tabs-1">
		    <p>The Grid widget is a ASP.NET MVC 5 great complement!</p>
	    </div>
	    <div id="tabs-2">
            <pre>

            </pre>
	    </div>
	    <div id="tabs-3">
            <pre class="brush: csharp">

            </pre>
	    </div>
	    <div id="tabs-4">
            <pre>

            </pre>
	    </div>
	    <div id="tabs-5">
	    </div>
    </div>